package com.lagou.util;

import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.TimerTask;

public class calculateTask extends TimerTask {

    @Override
    public void run() {
        Map<String,Long> result = RequestMetrics.calculate();
        if(result.size()>0){
            Set set=result.keySet();
            Object[] arr=set.toArray();
            Arrays.sort(arr);
            for(Object key:arr){
                System.out.println(key+"====="+result.get(key));
            }
            //System.out.println(result.toString());
        }
    }
}
